package com.zjs.server.comsumer.contoeller;

import com.zjs.server.comsumer.pojo.Person;
import com.zjs.server.comsumer.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PersonContorller {

    @Autowired
    private PersonService personService;

    @RequestMapping(value = "/addPerson")
    public String addPerson(){
        return personService.addPerson();
    }

    @RequestMapping(value = "/findPerson/{name}")
    public Person findPerson(@PathVariable(value = "name") String name){
        return personService.findPerson(name);
    }

}
